package com.ed100.sass.patter.observer;

import java.util.Enumeration;
import java.util.Vector;

public abstract class AbstractSubject implements SubjectInterface {
	Vector<ObserverInterface> vector = new Vector<ObserverInterface>();

	@Override
	public void add(ObserverInterface observer) {
		vector.add(observer);
	}

	@Override
	public void remove(ObserverInterface observer) {
		vector.remove(observer);
	}

	@Override
	public void notifyObservers() {
		Enumeration<ObserverInterface> els = vector.elements();
		while (els.hasMoreElements()) {
			ObserverInterface obs = els.nextElement();

			obs.update();
		}
	}
}
